<?php
include_once './calc/calc_constants.php'; 
?>
<h1 class='page_header'>Calculators</h1>
<p align="left"><span>All calculations are based on freshwater aquariums although some of them can be applied for saltwater tanks as well. These calculatators are based on my personal knowledge and experimentation. These will give you some ideas but please do not put your blind faith on them; rather verify, validate and adjust the results that best suites your needs.<b>WetChlorophylls.com should not be held responsible for problems arising of using these results.</b></span></p>
<div class="page-spanner center-holder">
	<div id="tabs">
		<div id="volume-tab" class="tab-active-left" onClick="showCalc('volume');">Volume/Quantity</div>
		<div id="concentration-tab" class="tab-inactive" onClick="showCalc('concentration')">Concentrations</div>
		<div id="dosing-tab" class="tab-inactive" onClick="showCalc('dosing')">Dosing</div>
		<div id="electricity-tab" class="tab-inactive" onClick="showCalc('electricity')">Electricity</div>
	</div>
</div>
<div class="page-spanner">&nbsp;</div>
<p align="center"><span id="form-msg"></span></p>
<div class="page-spanner">
	<div id="volume" class="sub-section-active"><?php include("./calc/volume_calc.php")?></div>
	<div id="concentration" class="sub-section-inactive">
		<div class="sub-tabs">
			<div id="co2-tab" class="tab-active-left" onClick="showSubCalc('co2','C')">CO2 Concentration</div>
			<div id="hardness-tab" class="tab-inactive" onClick="showSubCalc('hardness','C')">Mg/CaCO3 Concentration</div>
		</div>
		<div class="page-spanner">
			<div id="co2" class="sub-section-active"><?php include("./util/page_under_construction.php")?></div>
			<div id="hardness" class="sub-section-inactive"><?php include("./util/page_under_construction.php")?></div>
		</div>
	</div>
	<div id="dosing" class="sub-section-inactive"><?php include("./util/page_under_construction.php")?></div>
	<div id="electricity" class="sub-section-inactive"><?php include("./util/page_under_construction.php")?></div>
	<div id="calc-comments" class="sub-section-inactive">
		<div class="page-spanner">
			<div class="tab right">&nbsp;</div>
			<div id="calc-tab" class="sub-section-inactive clickable right" onclick="showCurrentCalc()"><strong>Back to calculator</strong></div>
		</div>
	<?php
	$what_type_of_comment = "comment for this calculator";
	include_once("./util/comment.php")
	?>
	</div>
</div>
<script type="text/javascript">
var currentCalc="volume";
var currentConcentrationCalc="co2";
var calcId = 1;
<?php
if (isset($_REQUEST["calc"]) and $_REQUEST["calc"] != "") {
?>
showCalc('<?php echo $_REQUEST["calc"]?>');
<?php
	if (isset($_REQUEST["subCalc"]) and $_REQUEST["subCalc"] != "") {
?>
showSubCalc('<?php echo $_REQUEST["subCalc"]?>','<?php echo $_REQUEST["calcType"]?>');
<?php
	}
}
?>
function setCalcFunction(func) {
	document.getElementById("func").value = func;
}
var calcCommentParams = new Array();
function reloadCalcComments(artifactType,artifactId,artifactName) {
	calcCommentParams["artifactType"] = artifactType;
	calcCommentParams["artifactId"] = artifactId;
	calcCommentParams["artifactName"] = artifactName;
	Paginator.updateParams(calcCommentParams);
	Paginator.go(1);
}

var artifactStatUrl = webRoot + "/php/datahandling/artifactStatsUpdateAndRetrieve.php";
function calcCommentCountUpdate() {
	var query = "artifactId=" + calcId + "&artifactType=C&update=N";
	Ajax.call("POST",artifactStatUrl,query,calcStatsCallback,false);
}
calcCommentCountUpdate();
</script>